package gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.EtchedBorder;

import component.MyMenuBar;
import component.MyToolBar;

public class MainForm extends JFrame {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	MyToolBar toolbar;
	MyToolBar toolbar1;
	MyToolBar toolbar2;
	public MyMenuBar menubar;
	public MainForm() {
		UIManager.LookAndFeelInfo look[]=UIManager.getInstalledLookAndFeels();
		try {
			UIManager.setLookAndFeel(look[3].getClassName());
		}catch(Exception e){
			e.printStackTrace();
		}
		setTitle("Chương Trình Quản Lý Vật Tư");
		setIconImage(Toolkit.getDefaultToolkit().getImage("images/Apps-krfb-icon.png"));
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setExtendedState(JFrame.MAXIMIZED_BOTH);
		pack();
		setResizable(false);
		giaodien();
	}
	void giaodien(){
		menubar=new MyMenuBar();
		setJMenuBar(menubar);
		toolbar=new MyToolBar();
		add(toolbar,BorderLayout.NORTH);
		toolbar1=new MyToolBar();
		toolbar1.setOrientation(MyToolBar.VERTICAL);
		toolbar1.remove(toolbar1.com);
		toolbar1.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
		add(toolbar1,BorderLayout.EAST);
		
		toolbar2=new MyToolBar();
		toolbar2.setOrientation(MyToolBar.VERTICAL);
		toolbar2.remove(toolbar2.com);
		toolbar2.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
		add(toolbar2,BorderLayout.WEST);
		
		JPanel pncen=new JPanel(new BorderLayout());
		pncen.setBorder(new EtchedBorder(null,Color.black));
		add(pncen,BorderLayout.CENTER);
		
		JPanel pnbot=new JPanel();
		pnbot.setPreferredSize(new Dimension(1000, 30));
		pnbot.setBorder(new EtchedBorder(null,Color.BLACK));
		pncen.add(pnbot,BorderLayout.SOUTH);
		
		JLabel lbwelcome=new JLabel("Trạng thái chưa đăng nhập---Welcome to you");
		lbwelcome.setForeground(Color.blue);
		pnbot.add(lbwelcome);
	}
}
